// @ts-ignore
/* eslint-disable */
import { request } from '@umijs/max';
const apiPrefix = '/web';

/** 修改组织 PUT /sys/org */
export async function sysOrgControllerEdit(body: API.SysOrgForm, options?: { [key: string]: any }) {
  return request<API.ApiResultObject>(`${apiPrefix}/sys/org`, {
    method: 'PUT',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 新增组织 POST /sys/org */
export async function sysOrgControllerAdd(body: API.SysOrgForm, options?: { [key: string]: any }) {
  return request<API.ApiResultObject>(`${apiPrefix}/sys/org`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 删除组织 DELETE /sys/org/${param0} */
export async function sysOrgControllerRemove(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.sysOrgControllerRemoveParams,
  options?: { [key: string]: any },
) {
  const { orgId: param0, ...queryParams } = params;
  return request<API.ApiResultObject>(`${apiPrefix}/sys/org/${param0}`, {
    method: 'DELETE',
    params: { ...queryParams },
    ...(options || {}),
  });
}

/** 基本信息 GET /sys/org/info */
export async function sysOrgControllerOrgInfo(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.sysOrgControllerOrgInfoParams,
  options?: { [key: string]: any },
) {
  return request<API.SysOrgVo>(`${apiPrefix}/sys/org/info`, {
    method: 'GET',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/** 组织成员 GET /sys/org/list */
export async function sysOrgControllerList(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.sysOrgControllerListParams,
  options?: { [key: string]: any },
) {
  return request<API.ApiResultPaginationSysOrgUserVo>(`${apiPrefix}/sys/org/list`, {
    method: 'GET',
    params: {
      ...params,
      pagination: undefined,
      ...params['pagination'],
      orgQuery: undefined,
      ...params['orgQuery'],
    },
    ...(options || {}),
  });
}

/** 组织树结构 GET /sys/org/tree */
export async function sysOrgControllerTree(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.sysOrgControllerTreeParams,
  options?: { [key: string]: any },
) {
  return request<API.TreeInteger[]>(`${apiPrefix}/sys/org/tree`, {
    method: 'GET',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/** 查看用户 GET /sys/org/user/${param0} */
export async function sysOrgControllerUserInfo(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.sysOrgControllerUserInfoParams,
  options?: { [key: string]: any },
) {
  const { userId: param0, ...queryParams } = params;
  return request<API.SysUserVO>(`${apiPrefix}/sys/org/user/${param0}`, {
    method: 'GET',
    params: { ...queryParams },
    ...(options || {}),
  });
}
